package six.event.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author jiangjinjian
 * @date 2024/5/9 9:06
 * @description 卦象枚举，1代表阳，0代表阴
 */
@AllArgsConstructor
@Getter
public enum HexagramEnum {

    QianGua("☰", "111", "乾"),

    DuiGua("☱", "011", "兑"),

    LiGua("☲", "101", "离"),

    ZhenGua("☳", "001", "震"),

    XunGua("☴", "110", "巽"),

    KanGua("☵", "010", "坎"),

    GenGua("☶", "100", "艮"),

    KunGua("☷", "000", "坤");

    private final String graph;

    private final String strNumber;

    private final String desc;

    public HexagramEnum valueAsEnum(String strNumber) {
        return Arrays.stream(values())
                .filter(o -> StrUtil.equals(o.getStrNumber(), strNumber))
                .findFirst().orElse(null);
    }
}
